package practice05;

import java.util.Scanner;

/**
 * @author Administrator
 * @version V1.0
 * @ProjectName:IntelliJ IDEA
 * @PackageName: practice05
 * @ClassName: TestAccount
 * @Description: TODO(这里用一句话描述这个类的作用)
 * @date 2019/12/1 16:01
 * @Copyright 大牛版板所有
 */
public class TestAccount {
    public static void main(String[] args) {
        Account admin = new Account();
        admin.funds = 5000;
        Scanner input = new Scanner(System.in);
        System.out.print("请输入账号：");
        admin.account = input.next();
        int num;
        do {
            System.out.print("请选择功能：");
            String function= input.next();
            if ("存款".equalsIgnoreCase(function)){
                System.out.print("请输入要存入的金额：");
                admin.depositNums = input.nextDouble();
                double funds = admin.deposit();
                System.out.println("你的账号余额为："+funds);
                admin.funds = funds;
            }
            else if ("取款".equalsIgnoreCase(function)){
                System.out.print("请输入取款金额：");
                admin.drawNums = input.nextDouble();
                double funds = admin.draw();
                System.out.println("你的账号余额为："+funds);
                admin.funds = funds;
            }
            else if ("余额查询".equalsIgnoreCase(function)){
                double funds = admin.fundInquiry();
                System.out.println("你的账号余额为："+funds);
            }
            else {
                System.out.println("你选择的功能不存在！");
            }
            System.out.print("输入0继续办理相关程序：");
            num = input.nextInt();
        }while (num == 0);

    }
}
